//
//  YZBaseWebViewController.h
//  VET
//
//  Created by YZ on 2018/7/17.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "YZBaseTopVC.h"
#import <WebKit/WebKit.h>

#define kActionKey   @"action"
#define kCallbackKey @"callback"
#define kDataKey        @"data"

@interface YZBaseWebViewController : YZBaseTopVC

- (instancetype)initWithUrl:(NSString *)url registerFunctions:(NSArray<NSString *> *)functions;

@property (nonatomic, strong, readonly) WKWebView *webView;

- (void)setWebViewFrame:(CGRect)rect;

- (void)setProgressViewFrame:(CGRect)rect;

- (void)customUserContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message;

- (void)customWebView:(WKWebView *)webView runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WKFrameInfo *)frame completionHandler:(void (^)(void))completionHandler;

- (void)customWwebView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler;

@end
